package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsOrderMapper;
import com.qf.mapper.StatMapper;
import com.qf.pojo.DtsOrder;
import com.qf.service.DtsOrderService;
import com.qf.vo.CategorySellAmts;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@Service
public class DtsOrderServiceImpl implements DtsOrderService {

    @Autowired
    DtsOrderMapper orderMapper;

    @Autowired
    StatMapper statMapper;

    @Override
    public Integer findTotal() {

        LambdaQueryWrapper<DtsOrder> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsOrder::getDeleted, false);

        Integer count = orderMapper.selectCount(wrapper);

        return count;
    }

    @Override
    public List<CategorySellAmts> findCategoryShellData() {
        return statMapper.findCategoryShellData();
    }

    @Override
    public List<DayStatis> queryDayStatis(int rang) {
        return statMapper.queryOrderStatis(rang);
    }


}
